#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isPossibleToSplit(vector<int>& nums) {
        unordered_map<int, int> hash;
        for (auto e : nums)
        {
            if (++hash[e] > 2) return false;
        }
        return true;
    }
};